<?php
/*-----------------------------------
* @author : Xsblog Team ' uknow
* @website: www.xsblog.net
* @version: Xsblog v1.0(Bg version)
* @update : 2011.02.20
-----------------------------------*/
class lib_timer{
	var $starttime;
	var $stoptime;
	var $spendtime;

	function getmicrotime(){
		list($usec,$sec)=explode(" ",microtime());
		return ((float)$usec + (float)$sec);
	}

	function start(){
		$this->starttime=$this->getmicrotime();
	}

	function display(){
		$this->stoptime=$this->getmicrotime();
		$this->spendtime=$this->stoptime-$this->starttime;
		return round($this->spendtime,4);
	}
}
